﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<OnlineMovieTicket.Model.TopTenMoviesDetail>>" %>
<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.2.js") %>" ></script>  
<script type="text/javascript" src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" ></script>  
<script type="text/javascript" src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>" ></script>  

    <table id="trGrid" width="600px">
        <tr>
            <td id="tdHeaderGrid"> 
                Movie Name
            </td>            
             <td id="tdHeaderGrid"> 
                Release Date
            </td>
             <td id="tdHeaderGrid"> 
                Status
            </td>             
            <td id="tdHeaderGrid"> 
                Customer Rating (Average)
           </td>
        </tr>

    <% foreach (var item in Model) 
       {
           var i= 1;var j= 0;
            %>
    
        <tr>         
            <td id="tdBodyGrid">          
                <%= item.topTenMoviesList[j].MovieName %>
            </td>
            <td id="tdBodyGrid">
             <%= String.Format("{0:dd MMM yyyy}",item.topTenMoviesList[j].ReleaseDate) %>
               
            </td>
            <td id="tdBodyGrid">
                                                                <% if (item.topTenMoviesList[j].Status == "N")
                                                                   { %>
                                                                    <%: "Now Showing"%>
                                                                <% } %>
                                                                <% if (item.topTenMoviesList[j].Status == "C")
                                                                   { %>
                                                                    <%: "Comming Soon"%>
                                                                <% } %>
                                                                <% if (item.topTenMoviesList[j].Status == "P")
                                                                   { %>
                                                                    <%: "Past"%>
                                                                <% } %>

                                                                </td>   
             
            <td id="tdBodyGrid">
                <%= item.TotalRate%>
            </td>
        </tr>
    
    <% j++; i++;
       } %>

    </table>

  